package cn.tedu.online.day04;

import java.util.concurrent.BlockingQueue;
import java.util.concurrent.LinkedBlockingQueue;

public class LambdaDemo2 {
    public static void main(String[] args) {
        BlockingQueue<Integer> queue = new LinkedBlockingQueue<>();
        Runnable thread = () -> {
              while (true){
                  try {
                      int a = (int)(Math.random()*1000);
                      queue.put(a);
                      System.out.println(queue);
                  } catch (InterruptedException e) {
                      e.printStackTrace();
                  }

              }
        };

        Thread thread1 = new Thread(thread,"555");


        thread1.start();

    }
}
